package com.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import lombok.Data;
import jakarta.persistence.Id;
import org.springframework.stereotype.Component;

import java.util.Date;

@Data
@Component
@Entity(name = "t_article")
public class BlogArticle {

//    private Integer id;
//    private String title;
//    private String content;
//    private Date created;
//    private Date modified;
//    private String categories;
//    private Integer hits;
//    private Integer commentsNum;
//    private String tags;
//    private Integer allowComment;
//    private String thumbnail;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY) //主键自动递增
    private Integer id;             //文章id
    private String title;           //文章标题
    private String content;         //内容
    private Date created;           //创建时间
    private Date modified;          //修改时间
    private String categories;      //分类
    private String tags;            //标签
    private Boolean allowComment;   //是否允许评论，默认true
    private String thumbnail;       //缩略图
    private Integer hits;           //点击量
    private Integer commentsNum;    //评论总数
}
